package com.sushi.controller;

import com.sushi.service.ManualService;
import com.sushi.response.ResponseBO;
import com.sushi.response.ResponsePageBO;
import com.sushi.response.ManualResp;
import com.sushi.request.ManualReq;
import com.sushi.request.ManualPageReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.*;

/**
 * 图鉴 控制器
 * @date 2023-05-02
 * @time 17:14:56
 * @author Administrator
 */
@RestController
@Slf4j
public class ManualController {

	@Autowired
	private ManualService manualService;

    

    /**
     * 新增
     */
    @PostMapping("/manual/add")
    public ResponseBO<ManualResp> add(@RequestBody ManualReq req) {
        return manualService.add(req);
    }

    /**
     * 逻辑删除
     */
    @PostMapping("/manual/remove")
    public ResponseBO<ManualResp> remove(@RequestBody ManualReq req) {
        return manualService.logicRemove(req);
    }

    /**
     * 更新
     */
    @PostMapping("/manual/update")
    public ResponseBO<ManualResp> update(@RequestBody ManualReq req) {
        return manualService.updateByField(req);
    }

    /**
     * 列表
     */
    @PostMapping("/manual/list")
    public ResponsePageBO<ManualResp> list(@RequestBody ManualPageReq req) {
        return manualService.listByCondition(req);
    }

    /**
     * 详情
     */
    @PostMapping("/manual/detail")
    public ResponseBO<ManualResp> detail(@RequestBody ManualReq req) {
        return manualService.detail(req);
    };

}